#pragma once
#ifndef ENTITYBOSS_H
#define ENTITYBOSS_H

#include "WorldEntity.h"
#include "Vector2D.h"


class CEntityBoss: public CWorldEntity
{
private:
	//those variables are static cause I need to give them a value before to create the object
	static int indexBody;
	static int indexSide;
	static int indexEye;
	static int indexMouth;
	static int indexAnimEye;
	static int indexAnimMouth;

	//offset
	int offsetXLeftSide;
	int offsetYLeftSide;
	int offsetXRightSide;
	int offsetYRightSide;
	int offsetXEye;
	int offsetYEye;
	int offsetXMouth;
	int offsetYMouth;
	//animation
	int currentFrameAnimationEye;
	int timeLastFrameAnimationEye;
	int currentFrameAnimationMouth;
	int timeLastFrameAnimationMouth;

	bool animationMouthOver;

	int timeToSpawn;
	bool entry;
	int totalHealth;

	bool explodeLeft;
	bool explodeRight;

	int timeSpawnLastProjectileLeft;
	int timeSpawnLastProjectileRight;
	int timeBetweenProjectile;
	int projectileTypeLeft;
	int projectileTypeRight;

	//interpolation
	CVector2D wayPointLeft;
	CVector2D wayPointRight;
	CVector2D nextWayPoint;
	CVector2D previousWayPoint;
	float timeLastWayPoint;

	int state;

public:
	CEntityBoss(int timeToSpawn, int indexProjectileLeft, int indexProjectileRight);
	~CEntityBoss(void);
	void update(void);
	void render(void);

	static void initialiseBoss(int indexBody, int indexSide, int indexEye, int indexMouth, 
		int indexAnimEye, int indexAnimMouth);
	void resetBoss(void);

	void shootProjectileLeft(void);
	void shootProjectileRight(void);
	void shootProjectileMiddle(void);
	void checkCollision(void);
	void calculPositionLERP(void);
	void die(void);
	


};
#endif
